@extends('layouts.default') @section('main')
    <link rel="stylesheet" href="/css/uniform.css" />
    <link rel="stylesheet" href="/css/select2.css" />
    <div id="content">
        <div id="content-header">
            <div id="breadcrumb">
                <a href="{{url('home')}}" title="返回首页" class="tip-bottom"><i class="icon-home"></i> 首页</a>
                <a href="#" class="current">直通车权限申请</a>
            </div>
        </div>
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span12">

                    <form action="{{url('ztcapply/search')}}" method="post">
                        <table>
                            <tr>
                                <th>
                                    <label >申请人账号 :</label>
                                </th>
                                <th>
                                    <div class="controls">
                                        <input type="text" class="span11" name="username" value="" placeholder="申请人账号" />
                                    </div>
                                </th>
                                <th>
                                    <label >申请人 :</label>
                                </th>
                                <th>
                                    <div class="controls">
                                        <input type="text" class="span11" name="nickname" value="" placeholder="申请人" />
                                    </div>
                                </th>
                                <th>
                                <th>
                                    <label >是否审核通过 :</label>
                                </th>
                                <th>
                                    <div class="controls">
                                        <select  name="status" class="span11" >
                                            <option value="">请选择</option>
                                            <option value="1">审核通过</option>
                                            <option value="-1">审核不通过</option>
                                            <option value="0">待审核</option>
                                        </select>
                                    </div>
                                </th>

                                <th>
                                    <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                    <div class="controls">
                                        <button type="submit" class="btn btn-info">查询</button>
                                    </div>
                                </th>
                            </tr>
                        </table>
                    </form>


                    <div class="widget-box">
                        <div class="widget-title"> <span class="icon"><i class="icon-th"></i></span>
                            <h5>权限申请</h5>
                        </div>
                        <div class="widget-content nopadding">
                            <table class="table table-bordered table-striped">
                                <thead>
                                <tr>
                                    <th>申请人账号</th>
                                    <th>申请人</th>
                                    <th>申请时间</th>
                                    <th>是否审核通过</th>
                                    <th>审核</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($lists as $key => $list)
                                    <tr class="gradeX">
                                        <td>@if($list->user){{$list->user->username}}@endif</td>
                                        <td>@if($list->user) @if($list->user->nickname){{$list->user->nickname}}@else{{$list->user->realname}}@endif @endif</td>
                                        <td>{{date('Y-m-d', strtotime($list->created_at->toDateTimeString()))}}</td>
                                        <td>@if($list->status == 1)<i class="icon-ok"></i>@elseif($list->status == 0)<i class="icon-question-sign"></i>@elseif($list->status == -1)<i class="icon-remove"></i>@endif</td>
                                        <td class="center">
                                            @if(in_array('edit',$actions))@if($list->status == 0)<a data-original-title="审核" class="tip" href="{{url('ztcapply/audit?id='.$list->id)}}"><i class="icon-pencil"></i></a>@else已审核@endif @endif
                                        </td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <?php echo $lists->render();?>
                </div>
            </div>
        </div>
    </div>
    <script src="/js/matrix.tables.js"></script>
@stop
